package top.yifengxiner.blockchain.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.yifengxiner.blockchain.pojo.vo.BLoginBody;
import top.yifengxiner.blockchain.service.BLoginService;
import top.yifengxiner.common.core.pojo.AjaxResult;

/**
 * @author ：baixiao
 * @date ：Created in 2021/5/11 17:13
 * @description：区块链登录
 * @modified By：
 * @version: 0.0.1$
 */
@Api("登录模块")
@RestController
@RequestMapping("/blockchain")
public class BLoginController
{

    @Autowired
    private BLoginService loginService;

    @ApiOperation("受教育者登录")
    @PostMapping("/educated_login")
    public AjaxResult educatedLogin(@RequestBody BLoginBody loginBody)
    {
        return loginService.login(loginBody);
    }

    @ApiOperation("教育机构登录")
    @PostMapping("/educator_login")
    public AjaxResult educatorLogin(@RequestBody BLoginBody loginBody)
    {
        return loginService.login(loginBody);
    }
}
